<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <script src="./lib/vue.js"></script>
</head>
<body>
<!--Vue实例所控制的这个元素区域，就是我们的V-->
<div id="app">
    <p>{{msg|msgFormat('今天')|test}}</p>
</div>
<script>

    // 定义一个 Vue 全局的过滤器
    Vue.filter('msgFormat', function (msg, arg) {
        return msg.replace('昨夜', arg)
    });
    Vue.filter('test', function (msg) {
        return msg + "============="
    })
    // 创建Vue实例，得到ViewModel
    var vm = new Vue({
        el: '#app',
        data: {
            msg: '昨夜雨疏风骤，浓睡不消残酒。试问卷帘人，却道海棠依旧。知否，知否？应是绿肥红瘦。'
        },
        methods: {},
    })
</script>
</body>
</html>